﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;


/// <summary>
///保存评论的相关信息的类
/// </summary>
public class Comment
{
    private int commentID;//评论编号，用来对评论排序等。
    private int movieID;
    private String userID;//评论者ID
    private String content;//评论内容
    private DateTime commentDateTime;


    public Comment()
    {
        //
        //TODO: 在此处添加构造函数逻辑
        //
    }

    public bool Add(int movieID,String userID,String content,DateTime commentTime)
    {
        String sql = "insert into tb_Comment(movieID,userID,content,commentTime) values('"
            + movieID + "','" + userID + "','" + content + "','" + commentTime + "')";
        SqlExecutor myExec = new SqlExecutor();
        return myExec.UpdateCmd(sql);
    }

    public bool delete(int commentID)
    {
        SqlExecutor myExec = new SqlExecutor();
        return myExec.UpdateCmd("delete from tb_Comment where commentID='" + commentID + "'");
    }


    public int MovieID
    {
        get { return movieID; }
        set { movieID = value; }
    }

    public String UserID
    {
        get { return userID; }
        set { userID = value; }
    }

    public String Content
    {
        get { return content; }
        set { content = value; }
    }

    public DateTime CommentDateTime
    {
        get { return commentDateTime; }
        set { commentDateTime = value; }
    }

    public int CommentID
    {
        get { return commentID; }
        set { commentID = value; }
    }


}

